#define _CRT_SECURE_NO_WARNINGS 1



#include<stdio.h>
#include<math.h>


int fun(int n)
{
	if (n == 0)
		return 1;
	int count = 0;
	while (n)
	{
		count++;
		n /= 10;
	}
	return count;
}
int main()
{
	long long i = 0, temp = 0, a = 0, b = 0;
	for (i = 0; i < 200000; i++)
	{
		temp = i * i;
		a = fun(i);
		b = 1;
		while (a--)
		{
			b *= 10;
		}
		temp %= b;
		if (temp == i)
			printf("%lld  ", i);
	}

	return 0;
}